<?php 
function my_autoloader($class) {
    include_once __DIR__."/{$class}".".php";
}
spl_autoload_register('my_autoloader');
function base64EncodeImage ($image_file) {
    $base64_image = '';
    $image_info = getimagesize($image_file);
    $image_data = fread(fopen($image_file, 'r'), filesize($image_file));
    $mine=$image_info['mime'];
    $base64_image = 'data:' . $mine . ';base64,' . chunk_split(base64_encode($image_data));
    return $base64_image;
}